﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TVGuide.DataAccess.Common
{
    public class Channel
    {
        #region Public Properties

        public short? CategoryId { get; set; }
        public int Id { get; set; }
        public String Name { get; set; }
        public short? CountryId { get; set; }
        public DateTime Date { get; set; }
        public short LanguageId { get; set; }
        public string ImageURL { get; set; }
        public short? Enabled { get; set; }
        public String DisplayName { get; set; }

        #endregion

        public Channel() { }

        #region Explicit Cast

        public static explicit operator channel(Channel c)
        {
            if(c == null)
                return null;
            channel chan = new channel();
            chan.categoryID = c.CategoryId;
            chan.channelID = c.Id;
            chan.date = c.Date;
            chan.countryID = c.CountryId;
            chan.languageID = c.LanguageId;
            chan.channelName = c.Name;
            chan.imgUrl = c.ImageURL;
            chan.enabled = c.Enabled;
            chan.displayName = c.DisplayName;
            return chan;
        }

        public static explicit operator Channel(channel c)
        {
            if (c == null)
                return null;
            Channel chan = new Channel();
            chan.CategoryId = c.categoryID;
            chan.Id = c.channelID;
            chan.Date = c.date;
            chan.CountryId = c.countryID;
            chan.LanguageId = c.languageID;
            chan.Name = c.channelName;
            chan.ImageURL = c.imgUrl;
            chan.Enabled = c.enabled;
            chan.DisplayName = c.displayName;
            return chan;
        }

        #endregion
    }
}
